package lab02.test11;

import static java.lang.Math.sqrt;

public class Square extends Rectangle {


    double diagonal() {
        return sqrt(length);
    }

    @Override
    public void printMyWay() {
        System.out.println("边长：" + length +
                "\n面积：" + area() + "\n周长：" + perimeter() + "\n对角线：" + diagonal()
        );
    }
}
